package work.xiaohong.websocket.vo;

import lombok.Data;
import work.xiaohong.websocket.valid.ReceiverGroup;
import work.xiaohong.websocket.valid.SenderAndReceiverGroup;
import work.xiaohong.websocket.valid.SenderGroup;

import javax.validation.constraints.*;
import java.io.Serializable;

/**
 * @author xiaohong
 * @version 1.0
 * @date 2021/9/26 0026 14:01
 * @description 获取好友聊天记录实体类
 */
@Data
public class MsgListVo implements Serializable {

    @NotNull(message = "发送者id不能为空",groups = {SenderGroup.class,SenderAndReceiverGroup.class})
    @NotEmpty(message = "发送者id不能为空",groups = {SenderGroup.class,SenderAndReceiverGroup.class})
    @NotBlank(message = "发送者id不能为空",groups = {SenderGroup.class,SenderAndReceiverGroup.class})
    @Null(message = "发送者id不能为空",groups = {ReceiverGroup.class})
    private String sender;

    @NotNull(message = "接收者id不能为空",groups = {ReceiverGroup.class,SenderAndReceiverGroup.class})
    @NotEmpty(message = "接收者id不能为空",groups = {ReceiverGroup.class,SenderAndReceiverGroup.class})
    @NotBlank(message = "接收者id不能为空",groups = {ReceiverGroup.class,SenderAndReceiverGroup.class})
    @Null(message = "发送者id不能为空",groups = {SenderGroup.class})
    private String receiver;

    @Min(value = 1,message = "页数最小为1",groups = {SenderGroup.class,ReceiverGroup.class,SenderAndReceiverGroup.class})
    private Integer page = 1;

    @Min(value = 5,message = "size最小为5",groups = {SenderGroup.class,ReceiverGroup.class,SenderAndReceiverGroup.class})
    @Max(value = 20,message = "size最大为20",groups = {SenderGroup.class,ReceiverGroup.class,SenderAndReceiverGroup.class})
    private Integer size = 20;

}
